package com.franklin.ideaplugin.mybatisrunner.psi;

import cn.hutool.crypto.digest.DigestUtil;
import com.franklin.ideaplugin.api.utils.psi.PsiMethodUtils;
import com.franklin.ideaplugin.mybatisrunner.utils.MybatisSqlUtils;
import com.franklin.ideaplugin.mybatisrunner.utils.MybatisXmlUtils;
import com.franklin.ideaplugin.mybatisrunner.utils.XmlUtils;
import com.franklin.ideaplugin.mybatisrunner.xml.node.MybatisNodeHandlers;
import com.intellij.psi.PsiAnnotation;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.xml.XmlTag;

/**
 * @author Ye Junhui
 * @since 2024/2/20
 */
public class MybatisXmlTag extends MybatisPsiElement<XmlTag> {

    public MybatisXmlTag(XmlTag psiElement) {
        super(psiElement);
        String id = MybatisXmlUtils.resolveSqlId(psiElement);
        this.key = id;
    }

    @Override
    public String buildSqlScript() {
        return psiElement.getText();
    }

    @Override
    public XmlTag getSqlXmlTag() {
        return this.psiElement;
    }
}
